#include <bits/stdc++.h>
using namespace std;
int n,t;
int c[1001];
long long f[1001];

int main() {
    cin >> n >> t;
    f[0] = 1;
    for (int i = 1; i <= n;i++) {
        cin >> c[i];
    }

    for (int i = 1; i <= n;i++) {
        for (int v = t; v >= c[i];v--) {
            f[v] = f[v] + f[v - c[i]];
        }
    }
    cout << f[t];
    return 0;
}